#include <stdio.h>
#define ASIZE 13370

int need_to_skip (int x, int *a, int n) //look for 'x' in 'a'
{
	register int t;
	for (t=0; t < n; t++) {
		if (x == a[t])
			return 1;
		//printf("x=%d *(a+%d)=%d\n", x, t, a[t]); //DEBUG
	}
	return 0;
}

int main ()
{
	int first[ASIZE/2], second[ASIZE/2];
	int fn, sn;
	register unsigned short i=0;

	freopen("arrays.in", "r", stdin);
	freopen("arrays.out", "w", stdout);

	scanf("%d", &fn);
	while (i < fn)
		scanf("%d", &first[i]), i++;
	i = 0;
	scanf("%d", &sn);
	while (i < sn)
		scanf("%d", &second[i]), i++;

	for (i=0; i < fn; i++) {
		if (need_to_skip(first[i], second, sn) == 1) {
			//printf("skipping first[%d] == %d\n", i, first[i]); //DEBUG
			continue;
		}
		else
			printf("%d ", first[i]);
	}
	printf("\n");
	//printf("fn=%d sn=%d\n", fn, sn); //DEBUG
	return 0;
}
